import Taro, { Component } from '@tarojs/taro'
import { View, Text, Swiper, SwiperItem, Image, ScrollView } from '@tarojs/components'
import './index.scss'

export default class ProdItemBanner extends Taro.Component {

    static defaultProps = {
        list: []
    }

    render() {
        const { list } = this.props
        const img = (list || []).map(item => {
            return (<SwiperItem className='banner_swiper-item'>
                <Image className='banner_swiper-item-img' src={item} />
            </SwiperItem>
            )
        })
        return (
            // <!-- 轮播图 -->
            <Swiper
                className='banner_swiper'
                indicatorDots
                autoplay={true}
                indicatorColor='#f2f2f2'
                interval='2000'
                duration='1000'
                indicatorActiveColor='#eb2444'>
                {
                    img
                }
            </Swiper>
            //   <!-- end  轮播图 -->
        )
    }
}